package cn.yuanqiao.web.controller.cqbc;
/**
 * @author 赵常飞
 * @date 2024/6/28 9:48
 */

import cn.yuanqiao.common.core.controller.BaseController;
import cn.yuanqiao.common.core.domain.AjaxResult;
import cn.yuanqiao.common.annotation.Log;
import cn.yuanqiao.common.enums.BusinessType;
import cn.yuanqiao.cqbc.tongji.service.ITongjiService;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 *@Author: 赵常飞
 *@Date: 2024/6/28 9:48
 *@Description:
 *@Note:
 */
@RestController
@RequestMapping("/cqbc/tongji")
public class TongjiController extends BaseController {

    @Autowired
    private ITongjiService iTongjiService;

    @GetMapping("/jstj")
    @Log(title = "接收统计", businessType = BusinessType.SELECT)
    public AjaxResult jstj(@RequestBody JSONObject json)
    {
        List<Map<String,String>> list= iTongjiService.jstj(json);
        return success(list);
    }

    @PostMapping("/exportjstj")
    @Log(title = "接收统计导出", businessType = BusinessType.EXPORT)
    public void exportjstj(@RequestBody JSONObject json, HttpServletResponse response) throws IOException {
        iTongjiService.exportjstj(json,response);
    }

    @GetMapping("/cktj")
    @Log(title = "出库统计", businessType = BusinessType.SELECT)
    public AjaxResult cktj(@RequestBody JSONObject json)
    {
        List<Map<String,String>> list= iTongjiService.cktj(json);
        return success(list);
    }

    @PostMapping("/exportcktj")
    @Log(title = "出库统计导出", businessType = BusinessType.EXPORT)
    public void exportcktj(@RequestBody JSONObject json, HttpServletResponse response) throws IOException {
        iTongjiService.exportcktj(json,response);
    }

    @GetMapping("/qztj")
    @Log(title = "全宗统计", businessType = BusinessType.SELECT)
    public AjaxResult qztj(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list= iTongjiService.qztj(json);
        return success(list);
    }

    @PostMapping("/exportqztj")
    @Log(title = "全宗统计导出", businessType = BusinessType.EXPORT)
    public void exportqztj(@RequestBody JSONObject json, HttpServletResponse response) throws IOException {
        iTongjiService.exportqztj(json,response);
    }

}
